<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加结论</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">

</head>
<body>
<div class="content">
    <div class="layui-tab" lay-filter="demo">
        <div class="layui-tab-content tabel-fold">
            <table id="dataList" lay-filter="dataList"></table>
        </div>
    </div>
</div>
<script src="/static/js/main.js"></script>
<script>
    var $
    var table = {};
    layui.use([ 'jquery','configureCom','configure','element', 'suggest', 'element', 'templateInit', 'sessionFun', 'bluebird', 'table', 'jsDictFile',  'matchDict'], function () {
        $ = layui.jquery;
        var configureCom = layui.configureCom;
        var configure = layui.configure;
        var suggest = layui.suggest;
        var templateInit = layui.templateInit;
        var sessionFun = layui.sessionFun;
        var element = layui.element;
        table = layui.table;
        var jsDictFile = layui.jsDictFile;
        var matchDict = layui.matchDict;
        var listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        var drawingData = sessionFun.get(configure.SESSION_DRAWING_DATA);
        var cols = [[
            {
                field: 'specialtyId', title: '专业', templet: function (d) {
                    return '<p>' + matchDict.name(d.specialtyId, configure.ALL_SPE) + '</p>'
                   /* return '<p>' + (d.specialtyName || '-') + '</p>'*/
                }
            },
            {
                field: 'expertScResult', title: '审查人', templet: function (d) {
                    if (d.resultScEditFlag) {
                        var html = '<select class="formData sc">' +
                            configureCom.selectReturnOption(configure.RESULT, d.expertScResult) +
                            '</select>';
                        return html;
                    } else {
                        return '<p>' + matchDict.name(d.expertScResult, configure.RESULT) + '</p>';
                    }
                }
            },
            {
                field: 'expertShResult', title: '审核人', templet: function (d) {
                    if (d.resultShEditFlag) {
                        var html = '<select class="formData sh">' +
                            configureCom.selectReturnOption(configure.RESULT, d.expertShResult) +
                            '</select>';

                        return html;
                    } else {
                        return '<p>' + matchDict.name(d.expertShResult, configure.RESULT) + '</p>';
                    }
                }
            },
            {
                field: 'leaderResult', title: '技术负责人结论', templet: function (d) {
                    return '<p>' + matchDict.name(d.leaderResult, configure.RESULT) + '</p>';
                }
            },
            {
                field: 'checkTimes', title: '审查轮数'
            }
        ]];
        //渲染表格
        configureCom.postDataAjax(configure.EXPERT_SPEC_RESULT_LIST_HTTP, {decId: listData.decId, specialtyId: drawingData.specialtyId  }).then(function (res) {
            var dataArr = [];
            dataArr.push(res.prjSpecResult);
            configureCom.tableRenderUserDefined({}, cols, dataArr, 'dataList',400);
        });
        //监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });
    });
    function getData(){
        return new Promise(function (res, rej) {
            var sc = $(".sc").val();
            var sh = $(".sh").val();
            var roleResults = 'sc-'+ sc +',' +'sh-'+ sh;
            res({result: roleResults});
        });
    }
</script>
</body>
</html>